const { throttle } = require('../../modules/function_throttle');

Component({
    properties: {
        index: {
            type: Number,
            value: 0
        },
        question: {
            type: Object,
            value() {
                return {};
            }
        },
        themeColor: {
            type: String,
            value: getApp().globalData.themeColor
        }
    },
    data: {},
    methods: {
        onTapOption: throttle(function (evt) {
            this.triggerEvent('change', {
                index: this.data.index,
                value: evt.currentTarget.dataset.value
            });
        }, 300)
    }
});
